from selenium.webdriver.common.by import By

from weekend.wework.base.wework_page import WeWorkPage


class SearchPage(WeWorkPage):
    def input_member(self, name: str):
        # 点击输入框
        self.find_and_sendkeys(By.XPATH, "//*[@resource-id='com.tencent.wework:id/jf8']", name)
        # 定位搜索结果
        eles = self.finds(By.XPATH, f"//*[@resource-id='com.tencent.wework:id/f4l']/child::*//*[@text='{name}']")
        result = [x.text for x in eles]
        return result


